<template>
    <div class="box">
        <div class="box-t tanxin">
            <ul class="box-ul tanxin">
                <li>新碟上架</li>
            </ul>
            <span class="ul-r">更多 >></span>
        </div>
        <div class="box-c tanxin">
            <div class="box-c-l tanxin">&lt;</div>
            <div class="box-c-c">
                <ul class="box-c-c-ul tanxin">
                    <li v-for="(item,index) in TopAlbum" :key="index">
                        <img :src="item.picUrl" alt=""><span class="play"></span>
                        <p class="f-thide ellipsis">{{item.name}}</p>
                        <p class=" title f-thide ellipsis">{{item.company}}</p>
                    </li>
                </ul>
            </div>
            <div class="box-c-r tanxin">&gt;</div>
        </div>
    </div>
</template>

<script>
import { TopAlbumApi } from "@/request/api";
export default {
    data() {
        return {
            TopAlbum: [],
        }
    },
    created() {
        TopAlbumApi().then(res => {
            // console.log(res)
            if (res.data.code === 200) {
                this.TopAlbum = res.data.weekData.slice(0, 5)
                // console.log(this.TopAlbum)
            }
        })
    }
}
</script>
 
<style lang = "less" scoped>
@import "../../assets/base.less";
.box{
    background-color: #fff !important;
}
.box-t {
    margin-top: 40px;
    border-bottom: 2px solid brown;
    justify-content: space-between;
    background-color: #fff;
    .box-ul {
        li {
            padding: 0 15px;
            margin: 15px 0;
            cursor: pointer;
        }
        li:first-child {
            font-size: 20px;
            padding-left: 0;
            border: none;
        }
    }

    .ul-r {
        cursor: pointer;
    }
}
.box-c{
    width: 100%;
    height: 200px;
    margin-top: 20px;
    border: 1px solid #ccc;
    background-color: #f4f4f4;
    justify-content: space-between;
    .box-c-l{
        width: 30px;
        height: 100%;
        justify-content: center;
        font-size: 25px;
        font-family: '宋体';
        font-weight: 700;
    }
    .box-c-c{
        width: 100%;
        height: 100%;
        .box-c-c-ul{
            width: 100%;
            height: 100%;
            li {
                float: left;
                width: 118px;
                height: 150px;
                margin-left: 11px;
                position: relative;
                overflow: hidden;
                &:hover .play {
                    display: block;
                }
        
                img {
                    width: 118px;
                    height: 100px;
        
                }
        
                .play {
                    position: absolute;
                    width: 22px;
                    height: 22px;
                    background: url(../../assets/images/index.png) no-repeat;
                    background-position: -267px -235px;
                    right: 0;
                    top: 78px;
                    display: none;
        
                }
        
                .f-thide {
                    line-height: 18px;
                    width: 110px;
                    color: #000;
                    cursor: pointer;
                    font-size: 12px;
                }
        
                .title f-thide {
                    line-height: 18px;
                    width: 110px;
                    color: #000;
                    cursor: pointer;
                    font-size: 12px;
                }
            }
            li:last-child{
                margin-right: 0;
            }
        }
    }
    .box-c-r{
        width: 30px;
        height: 100%;
        justify-content: center;
        font-size: 25px;
        font-family: '宋体';
        font-weight: 700;
    }
}
</style>